package com.cn.springcloudwechat.controller.vaccinestation;


import com.cn.springcloudwechat.common.ajax.AjaxRes;
import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.common.utils.base.Const;
import com.cn.springcloudwechat.model.vaccinestion.YmStationWorkVOrder;
import com.cn.springcloudwechat.model.vaccinestion.YmStationWorkVTime;
import com.cn.springcloudwechat.model.vaccinestion.YmVStation;
import com.cn.springcloudwechat.service.vaccinstation.VaccineStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
@RequestMapping("web/vaccinestation")
public class VaccineStationPhoneVController {
	
	@Autowired
	VaccineStationService vaccineStationService;

	/**
	 * 查询客户疫苗站
	 * @param ajaxRes
	 * @return
	 */
	@RequestMapping("/queryVaccineUser")
	public AjaxRes queryVaccineUser(AjaxRes ajaxRes,String stationName,String address,Page<YmVStation> page){
		try {
			Page<YmVStation> ymVStations = this.vaccineStationService.queryVaccineUserSer(stationName,address,page);
            ajaxRes.setSucceed(ymVStations,Const.DATA_SUCCEED);
        }catch (Exception e){
            ajaxRes.setFailMsg(e.getMessage());
        }
        return ajaxRes;
	}


	/**
	 * 疫苗站查询
	 * @param ajaxRes
	 * @param ymVStation
	 * @param page
	 * @return
	 */
	@RequestMapping("/queryVaccineStation")
	public AjaxRes queryVaccineStation(AjaxRes ajaxRes, YmVStation ymVStation, Page<YmVStation> page){
		try {
			Page<YmVStation> ymVStationPage = this.vaccineStationService.queryVaccineStationSer(ymVStation,page);
			ajaxRes.setSucceed(ymVStationPage,Const.DATA_SUCCEED);
		}catch (Exception e){
			ajaxRes.setFailMsg(e.getMessage());
		}
		return ajaxRes;
	}
	
}
